function ModifierSelectorViewer(){
	this.modifierSelector = document.getElementById('modifier_list');
	this.init();
}
ModifierSelectorViewer.prototype.init = function(){
	 // body... 
	 this.modifierSelector.addEventListener('change',function(event){
		var modifierName = this.value;
		if(activeObject.modifier == null || activeObject.modifier == undefined){
			var modifier = new Modifier(activeObject);
			console.log('添加了修改器');

		}
		else 
			var modifier = activeObject.modifier;
		// if(manager.getObjectNumber() <= 0) {
		// 	alert('请先选择要修改的模型！\n 如果场景中还没有模型，请先建模！');
		// 	this.selectedIndex = 0;
		// 	this.blur();
		// 	return;
		// }
		// console.log(modifier);
		switch (modifierName) {
			case "网格编辑器":
				// statements_1
				modifier.toMesh();
				// modifierViewer.addItem(modifierName);
				modifierViewer.update();
				break;
			case "布尔运算":
				modifier.booleanOperation();
				// modifierViewer.addItem(modifierName);
				modifierViewer.update();
				break;
			default:
				// statements_def
				break;
		}
	}); 
};

ModifierSelectorViewer.prototype.update = function(){
	var scope = this;
	clean();
	if(activeObject.type == "Mesh"){
		var option = document.createElement("option");
		option.innerHTML = "网格编辑器"
		this.modifierSelector.appendChild(option);

		option = document.createElement("option");
		option.innerHTML = "布尔运算"
		this.modifierSelector.appendChild(option);
	}

	if(activeObject.modifier != null){
		var num = activeObject.modifier.nameStack.length - 1;
		for(var i = 1;i < scope.modifierSelector.childNodes.length-1;i++){
			if(scope.modifierSelector.childNodes[i].innerHTML == activeObject.modifier.nameStack[num]){
				scope.modifierSelector.childNodes[i].selected = "selected";	
			}
		}
	}

	function clean(){
		for(var i = scope.modifierSelector.childNodes.length-1;i > 1;i--){
			scope.modifierSelector.removeChild(scope.modifierSelector.childNodes[i]);
		}
		scope.modifierSelector.childNodes[1].selected="selected";
	}
}



	